package com.openbravo.data.loader;

import com.openbravo.basic.BasicException;

public class SequenceForDerby extends BaseSentence
{
  private BaseSentence sent1;
  private BaseSentence sent2;
  private BaseSentence sent3;

  public SequenceForDerby(Session paramSession, String paramString)
  {
    this.sent1 = new StaticSentence(paramSession, "DELETE FROM  " + paramString);
    this.sent2 = new StaticSentence(paramSession, "INSERT INTO " + paramString + " VALUES (DEFAULT)");
    this.sent3 = new StaticSentence(paramSession, "SELECT IDENTITY_VAL_LOCAL() FROM " + paramString, null, SerializerReadInteger.INSTANCE);
  }

  public DataResultSet openExec(Object paramObject)
    throws BasicException
  {
    this.sent1.exec();
    this.sent2.exec();
    return this.sent3.openExec(null);
  }

  public DataResultSet moreResults()
    throws BasicException
  {
    return this.sent3.moreResults();
  }

  public void closeExec()
    throws BasicException
  {
    this.sent3.closeExec();
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.data.loader.SequenceForDerby
 * JD-Core Version:    0.6.0
 */